// ---------------------------------------------------------------------
//
// -- 获得道具面板
// -- author £
//
// ---------------------------------------------------------------------

const CommonUtil = require('CommonUtil'),
    superClass = require('AlertWindow');

cc.Class({
    extends: superClass,

    properties: {
        btnGet: cc.Node,
        btnGetOld: cc.Node,
        btnSkip: cc.Node,
        toggleAuto: cc.Toggle,
        adLayer: cc.Node,
        noAdLayer: cc.Node,
        lbName: cc.Label,
        lbCount: cc.Label
    },

    ctor: function () {
    },

    // LIFE-CYCLE CALLBACKS:

    onLoad () {
        let UIManager = require('UIManager'),
            adEnable = require('Platform').videoAdEnable();

        CommonUtil.mysuper(superClass, this, 'onLoad');
        this.node.height = UIManager.getRealH();
        // this.numBonus.updateNum('a' + require('GameConfig').reviveScore() + 'b');
        this.adLayer.active = adEnable;
        this.noAdLayer.active = !adEnable;
    },

    start () {
    },

    show: function (itemName, count) {
        // let autoRevive = require('CommonInfo').getAutoRevive();

        // if (autoRevive === undefined || autoRevive === null)
        //     autoRevive = true;

        CommonUtil.mysuper(superClass, this, 'show');
        // this.toggleAuto.isChecked = autoRevive;
        // this.numScore.updateNum(score);
        this.lbName.string = '获得' + itemName;
        this.lbCount.string = '×' + count;
    },

    hide: function (data) {
        CommonUtil.mysuper(superClass, this, 'hide');
    },

    updateCD: function (time) {
        this.numCd.updateNum(time);
    },

    getData: function () {
        return this.toggleAuto.isChecked;
    },

    // update (dt) {
    // },
});
